import React from 'react'
import { Card } from 'antd'
import PageWrapper from 'components/PageWrapper'
// import TableX from 'components/TableX'
// import Options from 'components/TableX/Options'

// import axios from 'axios'
// import { checkres, session } from 'utils'
// import { SERVER, SERVER_ADMIN } from 'configs/service'

export default function VehicleList() {
  // const recordRef = React.useRef({})
  // const tableXRef = React.useRef()
  // const paramsRef = React.useRef()
  // const [modalEdit, setModalEdit] = React.useState({ visible: false })
  // const [regionData, setRegionData] = React.useState([])

  return (
    <PageWrapper>
      <Card>
        123
        {/* <TableX
          rowKey="id"
          ref={tableXRef}
          request={request}
          toolbarButtons={[
            {
              preset: 'add',
              onClick: () => setModalEdit({ mode: 'add', visible: true }),
            },
          ]}
          columns={[
            { dataIndex: 'chipModel', title: '芯片型号11111' },
            { dataIndex: 'departmentName', title: '供应商111111' },
            {
              dataIndex: 'chipFile',
              title: '芯片资质文件111111',
              render: v =>
                v == null ? (
                  '暂无附件'
                ) : (
                  <a
                    href={`${SERVER}/uploadFile/base64Read?id=${v}&Authorization=${session.Authorization}`}
                  >
                    点击下载
                  </a>
                ),
            },
            {
              dataIndex: 'options',
              title: <span style={{ marginRight: 8 }}>操作</span>,
              render: (v, o) => (
                <Options
                  buttons={[
                    {
                      preset: 'edit',
                      onClick: () => {
                        recordRef.current = o
                        setModalEdit({ mode: 'update', visible: true })
                      },
                    },
                    {
                      preset: 'del',
                      onClick: () => {
                        axios
                          .get('/chip/deleteChip', {
                            params: { chipIds: o.id },
                          })
                          .then(res => {
                            if (res.data.code === 1) {
                              message.success('删除成功')
                              tableXRef.current.update()
                            } else {
                              message.error(res.data.msg)
                            }
                          })
                      },
                    },
                  ]}
                ></Options>
              ),
            },
          ]}
        /> */}
      </Card>
    </PageWrapper>
  )
}
